﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Coldairarrow.Entity.Interface
{
    /// <summary>
    /// 九方库存
    /// </summary>
    /// 


    public class JF_ProductInventory
    {
        /// <summary>
        /// ID
        /// </summary>
        public string ID { get; set; }
        public string RowId { get; set; }


        /// <summary>
        /// 产品编码
        /// </summary>
        public string product_barcode { get; set; }
        /// <summary>
        /// SKU
        /// </summary>
        public string product_sku { get; set; }
        /// <summary>
        /// 定义编码
        /// </summary>
        public string reference_no { get; set; }

        /// <summary>
        /// 产品名称	
        /// </summary>
        public string product_title { get; set; }
        /// <summary>
        /// 产品名称(英文)
        /// </summary>
        public string product_title_en { get; set; }
        /// <summary>
        /// 仓库代码	
        /// </summary>
        public string warehouse_code { get; set; }
        /// <summary>
        /// 在途数量
        /// </summary>
        public decimal onway { get; set; }


        /// <summary>
        /// 待上架数量
        /// </summary>
        public decimal pending { get; set; }

        /// <summary>
        /// 可售数量	
        /// </summary>
        public decimal sellable { get; set; }
        /// <summary>
        /// 不合格数量	
        /// </summary>
        public decimal unsellable { get; set; }
        /// <summary>
        /// 待出库数量	
        /// </summary>
        public decimal reserved { get; set; }
        /// <summary>
        /// 历史出库数量	
        /// </summary>
        public decimal shipped { get; set; }
        /// <summary>
        /// 分享库存出库数量	
        /// </summary>
        public decimal sold_shared { get; set; }

        /// <summary>
        /// 分享库存数量
        /// </summary>
        public decimal shared { get; set; }

        /// <summary>
        /// 预警库存数量	
        /// </summary>
        public decimal warning { get; set; }

        /// <summary>
        /// 库存最新修改时间	
        /// </summary>
        public string pi_update_time { get; set; }

        /// <summary>
        /// 仓库描述
        /// </summary>
        public string warehouse_desc { get; set; }

        /// <summary>
        /// 批次信息
        /// </summary>
        public List<Batch_Info> batch_info { get; set; }


        /// <summary>
        /// 入库单号
        /// </summary>
        public string batch_info_receiving_code { get; set; }
        /// <summary>
        /// 可售数量
        /// </summary>
        public decimal batch_info_sellable_quantity { get; set; }
        /// <summary>
        /// 待出库数量
        /// </summary>
        public decimal batch_info_reserved_quantity { get; set; }
        /// <summary>
        /// 库龄
        /// </summary>
        public decimal batch_info_stock_age { get; set; }
        /// <summary>
        /// 库位
        /// </summary>
        public string batch_info_lc_code { get; set; }
        /// <summary>
        /// 上架时间
        /// </summary>
        public string batch_info_ib_fifo_time { get; set; }
        /// <summary>
        /// 状态：0-不可用，1-可用
        /// </summary>
        //public string batch_info_ib_status { get; set; }

        public string batch_info_ib_status_;
        public string batch_info_ib_status
        {

            get { return batch_info_ib_status_; }


            set
            {

                if (value == "0") batch_info_ib_status_ = "不可用";
                else if (value == "1") batch_info_ib_status_ = "可用";
                else batch_info_ib_status_ = value;
            }


        }

        /// <summary>
        /// 库存类型,0:标准 1:不良品,2暂存
        /// </summary>
        //public string batch_info_ib_type { get; set; }

        public string batch_info_ib_type_;
        public string batch_info_ib_type
        {

            get { return batch_info_ib_type_; }


            set
            {

                if (value == "0") batch_info_ib_type_ = "标准";
                else if (value == "1") batch_info_ib_type_ = "不良品";
                else if (value == "2") batch_info_ib_type_ = "暂存";
                else batch_info_ib_type_ = value;
            }


        }

        public class Batch_Info
        {
            /// <summary>
            /// 入库单号
            /// </summary>
            public string receiving_code { get; set; }
            /// <summary>
            /// 可售数量
            /// </summary>
            public decimal sellable_quantity { get; set; }
            /// <summary>
            /// 待出库数量
            /// </summary>
            public decimal reserved_quantity { get; set; }
            /// <summary>
            /// 库龄
            /// </summary>
            public decimal stock_age { get; set; }
            /// <summary>
            /// 库位
            /// </summary>
            public string lc_code { get; set; }
            /// <summary>
            /// 上架时间
            /// </summary>
            public string ib_fifo_time { get; set; }
            /// <summary>
            /// 状态：0-不可用，1-可用
            /// </summary>
            //public string ib_status_;
            //public string ib_status
            //{

            //    get { return ib_status_; }


            //    set
            //    {

            //        if (ib_status == "0") ib_status_ = "不可用";
            //        else if (ib_status == "1") ib_status_ = "可用";
            //        else ib_status_ = ib_status;
            //    }


            //}
            public string ib_status { get; set; }
            /// <summary>
            /// 库存类型,0:标准 1:不良品,2暂存
            /// </summary>
            //public string ib_type_;
            //public string ib_type
            //{

            //    get { return ib_type_; }


            //    set
            //    {

            //        if (ib_type == "0") ib_type_ = "标准";
            //        else if (ib_type == "1") ib_type_ = "不良品";
            //        else if (ib_type == "2") ib_type_ = "暂存";
            //        else ib_type_ = ib_type;
            //    }


            //}
            public string ib_type { get; set; }
        }

    }

}
